package com.fruit.service.impl;

import java.io.Serializable;
import java.util.List;

import com.fruit.service.BaseService;
import com.fruit.system.model.Pager;

public abstract class BaseServiceImpl<T> implements BaseService<T>
{
	
	@Override
	public Object saveEntity(T t)
	{
		return getEntityDao().saveEntity(t);
	}

	@Override
	public void saveOrUpdateEntity(T t)
	{
		getEntityDao().saveOrUpdateEntity(t);
	}

	@Override
	public void deleteEntity(T t)
	{
		 getEntityDao().deleteEntity(t);
	}

	@Override
	public void updateEntity(T t)
	{
		getEntityDao().updateEntity(t);
	}

	@Override
	public List<T> findAllEntity()
	{
		return getEntityDao().findAllEntity();
	}
	@Override
	public T loadEntity(Serializable id)
	{
		return getEntityDao().loadEntity(id);
	}

	@Override
	public T getEntity(Serializable id)
	{
		return getEntityDao().getEntity(id);
	}

	@Override
	public Object findUniqueResultByHql(String hql, Object... values)
	{
		return getEntityDao().findUniqueResultByHql(hql, values);
	}

	@Override
	public void batchEntityByHql(String hql, Object... values)
	{
		getEntityDao().batchEntityByHql(hql, values);
	}

	@Override
	public List<T> executeFindSql(String sql, Object... values)
	{
		return getEntityDao().executeFindSql(sql, values);
	}

	@Override
	public <E> List<E> executeFindSql(Class<E> clz, String sql, Object... values)
	{
		return getEntityDao().executeFindSql(clz, sql, values);
	}

	@Override
	public void executeUpdateSql(String sql, Object... values)
	{
		getEntityDao().executeUpdateSql(sql, values);
	}

	@Override
	public Pager<T> executeFindSqlByPager(String sql, Object... values)
	{
		return getEntityDao().executeFindSqlByPager(sql, values);
	}

	@Override
	public <E> Pager<E> executeFindSqlByPager(Class<E> clz, String sql,
			Object... values)
	{
		return getEntityDao().executeFindSqlByPager(clz, sql, values);
	}

	@Override
	public Pager<T> findAllEntityByPager()
	{
		return getEntityDao().findAllEntityByPager();
	}

	@Override
	public Pager<Object> findEntityByPager(String hql, Object... values)
	{
		return getEntityDao().findEntityByPager(hql, values);
	}
}
